using System;
using System.Data.Objects;
using System.Data.EntityClient;

namespace JingQiao.Ads.Infrastructure.Data.EF
{
    using DomainObject;

    public partial class AdsContext : ObjectContext
    {
        public const string ConnectionString = "name=AdsContext";
        public const string ContainerName = "AdsContext";

        #region Constructors

        public AdsContext()
            : base(ConnectionString, ContainerName)
        {
            this.ContextOptions.LazyLoadingEnabled = true;

        }

        public AdsContext(string connectionString)
            : base(connectionString, ContainerName)
        {
            this.ContextOptions.LazyLoadingEnabled = true;
        }

        public AdsContext(EntityConnection connection)
            : base(connection, ContainerName)
        {
            this.ContextOptions.LazyLoadingEnabled = true;
        }

        #endregion

        #region ObjectSet Properties

        public ObjectSet<Advertisement> Advertisement
        {
            get { return _advertisement ?? (_advertisement = CreateObjectSet<Advertisement>("Advertisement")); }
        }
        private ObjectSet<Advertisement> _advertisement;

        public ObjectSet<ConfigInfo> ConfigInfo
        {
            get { return _configInfo ?? (_configInfo = CreateObjectSet<ConfigInfo>("ConfigInfo")); }
        }
        private ObjectSet<ConfigInfo> _configInfo;

        public ObjectSet<Destination> Destination
        {
            get { return _destination ?? (_destination = CreateObjectSet<Destination>("Destination")); }
        }
        private ObjectSet<Destination> _destination;

        public ObjectSet<DestPositionAd> DestPositionAd
        {
            get { return _destPositionAd ?? (_destPositionAd = CreateObjectSet<DestPositionAd>("DestPositionAd")); }
        }
        private ObjectSet<DestPositionAd> _destPositionAd;

        public ObjectSet<Position> Position
        {
            get { return _position ?? (_position = CreateObjectSet<Position>("Position")); }
        }
        private ObjectSet<Position> _position;

        public ObjectSet<Template> Template
        {
            get { return _template ?? (_template = CreateObjectSet<Template>("Template")); }
        }
        private ObjectSet<Template> _template;

        #endregion
    }
}
